<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title></title>
	<link rel="stylesheet" href="">
</head>
<body>
<script src="https://cdn.bootcss.com/vue/2.5.8/vue.js"></script>
<div id="root">
	<p>{{VueMsg}}</p>
	<parent></parent>
</div>	
<script>
	Vue.component('parent',{
		data : function(){
			return {
				fatherMsg : '你好啊,Ken',
			};
		},
		template : `
			<div>
				<h1>这是父组件 : <span>{{fatherMsg}}</span></h1>
				<hr />
				<child></child>
			</div>
		`,
	});
	Vue.component('child',{
		data : function(){
			return {
				sonMsg : '',
			};
		},
		template : `
			<div>
				<h1>这是在子组件 : <span>已经获得父组件的信息 --> {{sonMsg}}</span></h1>
				<button @click='recvFromFatherSonMsg'>recvFromFatherSonMsg</button>
				
			</div>
		`,
		methods : {
			recvFromFatherSonMsg : function(){
				this.sonMsg = this.$parent.fatherMsg;
			}
		}
	});
	var vm = new Vue({
		el : '#root',
		data : {
			VueMsg : 'Hello VueJs !',
		}
	})
</script>
</body>
</html>